/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bgIntlgn.client.entity.privilege;

import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 *
 * @author yuhuibear
 */
@Table(name = "roles", constrain = "")
public class Role implements Bean {

    @Field(name = "name", type = "char(40)", constrain = "primary key")
    private String name;
    
    @Field(name = "description", type = "varchar(100)", constrain = "")
    private String description;
    
    public String getDescription() {
    	return description;
    }
    public void setDescription(String _description) {
    	description = _description;
    }
    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Role other = (Role) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        return true;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name.trim();
    }
}
